import request from '@/utils/request'

// 查询成员列表
export function listMembers(query) {
  return request({
    url: '/system/member/list',
    method: 'get',
    params: query
  })
}

// 查询成员详细
export function getMembers(memberId) {
  return request({
    url: '/system/member/' + memberId,
    method: 'get'
  })
}

// 查询成员详细
export function getMembersByClubId(clubId) {
  return request({
    url: '/system/member/getInfoByClubId/' + clubId,
    method: 'get'
  })
}

// 新增成员
export function addMembers(data) {
  return request({
    url: '/system/member',
    method: 'post',
    data: data
  })
}

// 修改成员
export function updateMembers(data) {
  return request({
    url: '/system/member',
    method: 'put',
    data: data
  })
}

// 删除成员
export function delMembers(memberId) {
  return request({
    url: '/system/member/' + memberId,
    method: 'delete'
  })
}

// 审核通过成员申请
export function approveMember(data) {
  return request({
    url: '/system/member/approve',
    method: 'post',
    data: data
  })
}

// 拒绝成员申请
export function rejectMember(data) {
  return request({
    url: '/system/member/reject',
    method: 'post',
    data: data
  })
}

// 撤销申请
export function unapply(clubId) {
  return request({
    url: '/system/member/unapply/' + clubId,
    method: 'post'
  })
}
